<?php
// +----------------------------------------------------------------------
// | snake
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2022 http://baiyf.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: NickBai <1902822973@qq.com>
// +----------------------------------------------------------------------
namespace app\common\model;

use think\Model;

class Admin extends BaseModel
{
    public $createTime = false;
    public $updateTime = false;
    /**
     *  初始化模型
     * @access protected
     * @return void
     */
    protected function initialize()
    {
        parent::initialize();
    }

    public function getTableFieldsComment(){
        return [
            [
                $this->commentFieldName => '{"disc":"序号","name":"id","type":"hidden","type_value_custom":null,"type_value":[],"show":{"list":{"checked":false,"cv":""},"add":{"checked":true,"cv":""},"edit":{"checked":true,"cv":""},"view":{"checked":false,"cv":""}},"validate":{"require":false},"isSearch":false,"search":{"text":"","op":"="}}'
            ],
            [
                $this->commentFieldName => '{"disc":"用户名","name":"admin_username","type":"text","type_value_custom":null,"type_value":[],"show":{"list":{"checked":true,"cv":""},"add":{"checked":true,"cv":""},"edit":{"checked":true,"cv":""},"view":{"checked":true,"cv":""}},"validate":{"require":false},"isSearch":true,"search":{"text":"用户名","op":"LIKE"}}'
            ],
            [
                $this->commentFieldName => '{"disc":"密码","name":"admin_pwd","type":"password","type_value_custom":null,"type_value":[],"show":{"list":{"checked":false,"cv":""},"add":{"checked":true,"cv":""},"edit":{"checked":true,"cv":""},"view":{"checked":false,"cv":""}},"validate":{"require":false},"isSearch":false,"search":{"text":"用户名","op":"LIKE"}}'
            ],
            [
                $this->commentFieldName => '{"disc":"真实姓名","name":"admin_realname","type":"text","type_value_custom":null,"type_value":[],"show":{"list":{"checked":true,"cv":""},"add":{"checked":true,"cv":""},"edit":{"checked":true,"cv":""},"view":{"checked":true,"cv":""}},"validate":{"require":false},"isSearch":true,"search":{"text":"真实姓名","op":"LIKE"}}'
            ],
            [
                $this->commentFieldName => '{"disc":"状态","name":"admin_open","type":"select","type_value_custom":null,"type_value":[{"text":"开启","id":"1"},{"text":"禁用","id":"2"}],"show":{"list":{"checked":true,"cv":""},"add":{"checked":true,"cv":""},"edit":{"checked":true,"cv":""},"view":{"checked":true,"cv":""}},"validate":{"require":false},"isSearch":true,"search":{"text":"状态","op":"="}}'
            ],
        ];
    }

    public function getTableComment(){
        return '{"tableName":"管理员表","additionalFields":{"list":[{"name":"group_name","text":"分组","type":"select","cv":"get_groups|$id","sort":3}],"add":[{"name":"group_id","text":"分组","type":"select","cv":"getSelectDropDown|AuthGroup|id|title","sort":3}],"edit":[{"name":"group_id","text":"分组","type":"select","cv":"getSelectDropDown|AuthGroup|id|title","sort":3}]}}';
    }
}